package com.ty.controller;

import com.ty.entity.ProductPrice;
import com.ty.entity.ProductPriceQuery;
import com.ty.service.ProductPriceServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/api/price")
public class ProductPriceController {
    @Autowired
    private ProductPriceServer productPriceServer;

    /**
     * 查询接口
     */
    @GetMapping
   public List<ProductPrice> select (ProductPriceQuery query){
        return productPriceServer.select(query);
    }

    @PostMapping
    public Integer insert (@RequestBody ProductPrice product){
        return productPriceServer.insert(product);
    }

    @PutMapping
    public Integer update(@RequestBody ProductPrice product){
        return productPriceServer.update(product);
    }
    @DeleteMapping
    public Integer delete(Integer id){
        return productPriceServer.delete(id);
    }
}
